Skip to content

[Codegen] Use DMA for LHS/RHS only in scaled matmul#23760

Draft
lialan wants to merge 3 commits intousers/lialan/subbyte_gather_to_ldsfrom
users/lialan/lower_dma_when_scaled
Draft

[Codegen] Use DMA for LHS/RHS only in scaled matmul#23760
lialan wants to merge 3 commits intousers/lialan/subbyte_gather_to_ldsfrom
users/lialan/lower_dma_when_scaled

Conversation

@lialan
Copy link
Contributor

@lialan lialan commented Mar 12, 2026

Step 2 of enabling DMA for scaled GEMMs. This patch will enable DMA for scaled GEMM, but will disable XOR swizzle at the same time.

  • For now, remove the blanket guard that disabled DMA for all scaled matmuls.
  • When manually enable DMA, XOR swizzle will get disabled (for now). But DMA is by default off so we are good.
  • Use DMA (UseGlobalLoadDMAAttr) for LHS/RHS operands.
  • Fix lowering of DMA copy.

@lialan lialan force-pushed the users/lialan/lower_dma_when_scaled branch from d3c3f1d to f654410 Compare March 12, 2026 20:09
* For now, remove the blanket guard that disabled DMA for all scaled matmuls.
* When manually enable DMA, XOR swizzle will get disabled (for now).
* Use DMA (UseGlobalLoadDMAAttr) for LHS/RHS operands.
* Fix lowering of DMA copy.
@lialan lialan force-pushed the users/lialan/lower_dma_when_scaled branch from f654410 to 88f6a9a Compare March 12, 2026 21:25
@lialan lialan force-pushed the users/lialan/lower_dma_when_scaled branch from 6e49c10 to c1f3a75 Compare March 13, 2026 02:17
@lialan
Copy link
Contributor Author

lialan commented Mar 13, 2026

Working on DMA with XOR Swizzle support in a subsequent PR.

Revert destination indices from divergent (srcLinearOffset) back to
subgroup-uniform (linearOffsetVal). The gather_to_lds op contract
specifies that only lane 0's dstIndices are used, so the dst base
must be uniform. Also add a TODO in the scaled matmul DMA pipeline
test noting that gather_to_lds is not yet produced for scaled operands.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant